/*
	The game of life
	----------------
	The game of life takes place on a grid of cells. Each cell can be either
	alive or dead. These cells change over generations according to the
	following rules:

		* If more than 3 cells or less than two cells surround a living cell,
		  it dies
		* If there are exactly 2 cells surrounding a dead cell, it gets (re)born
*/

#include <iostream>
#include "gol.h"
using namespace std;

int main(){
    Gol lifestage("grid.def");
    char x=' ';
    /*  Instructions    */
    cout << "Type 'n' <enter> for the next generation" << endl;
    cout << "Type 'q' <enter> to quit" << endl << endl;

	while (x != 'q'){
		cout << "Generation " << lifestage.get_generation() << endl;
		lifestage.show();
		lifestage.calculate();
		cin >> x;
	}

	return 0;
}
